package com.totoro.tyrank.executor.action.impl;

import com.totoro.tyrank.constants.ActionConst;
import com.totoro.tyrank.executor.action.ActionExecutor;
import com.totoro.tyrank.utils.StrUtil;
import org.bukkit.entity.Player;

public class DelayActionExecutor implements ActionExecutor {
    @Override
    public void execute(String actionText, Player player) {
        actionText = StrUtil.getContentAfter(actionText, ActionConst.DELAY).trim();
        Integer delay = Integer.parseInt(actionText);
        try {
            Thread.sleep(delay * 50L);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }
}
